#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
    vector<int>ans;//答案数组
    int maxr = 0;//最大坐标信号
    vector<int> bestCoordinate(vector<vector<int>>& towers, int radius) {
        for (int i = 0; i <= 50; i++)//棋盘大小遍历x
        {
            for (int j = 0; j <= 50; j++)//棋盘大小遍历y
            {
                int sign = 0;//每个点的信号量
                for (int k = 0; k < towers.size(); k++)
                {
                    int a = towers[k][0],/*信号塔的x与y轴*/ b = towers[k][1], /*塔与点的距离*/distance = (a - i) * (a - i) + (b - j) * (b - j);
         
                    if((distance>=(radius*radius)))
                        sign+=towers[k][2]/(distance+1);
                }
                if (maxr < sign)
                {
                    maxr = sign;
                    ans = { i,j };
                }
             }
            
        }
        return ans;
    }
};